package org.tarena.dang.action.user;

import org.tarena.dang.action.BaseAction;
import org.tarena.dang.entity.User;

public class CheckLoginAction extends BaseAction {

    private boolean ok=false;
    
    public String execute() throws Exception{
        if (session.containsKey("user")){
            User user = (User)session.get("user");
            if (user != null){
                ok=true;
            }else{
                ok=false;
            }
        }else{
            ok=false;
        }
        return SUCCESS;
    }

    public boolean isOk() {
        return ok;
    }

    public void setOk(boolean ok) {
        this.ok = ok;
    }
    
}
